package com.tandashi.springbootstudy01.study.thread;

public class LoginServlet {
    private static String userNameRef;
    private static String passWordRef;

    synchronized public static void doPost(String userName, String passWord) {
        userNameRef = userName;
        try {
            if (userName.equals("a")) {
                Thread.sleep(1000);
            }
            passWordRef = passWord;
            System.out.println("userName=" + userNameRef + ",passWord=" + passWordRef);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
